# coding = utf-8
import datetime

from gaokao.models import Yxzyxxb_lg, Yxzyxxb_ws
from rest_framework import serializers
from rest_framework.serializers import ModelSerializer


class CollegeAdmissionSerializer(ModelSerializer):
    """
    院校专业信息表
    """
    eyy_name = serializers.CharField(source="get_eyy_display", read_only=True)
    jbw_name = serializers.CharField(source="get_jbw_display", read_only=True)
    zybs_name = serializers.CharField(source="get_zybs_display", read_only=True)
    qjjh_name = serializers.CharField(source="get_qjjh_display", read_only=True)
    sylzy_name = serializers.CharField(source="get_sylzy_display", read_only=True)
    xzzy_name = serializers.CharField(source="get_xzzy_display", read_only=True)
    tjsx_name = serializers.CharField(source="get_tjsx_display", read_only=True)
    gzdz = serializers.CharField(source="get_gzdz_display", read_only=True)

    class Meta:
        model = Yxzyxxb_lg
        fields = [
            'yxbsm', 'yxdm', 'yxmc', 'zybm', 'zymc', 'eyy_name', 'jbw_name', 'zybs_name', 'qjjh_name', 'syljs', 'lqpc', 'jhrs', 'qnjhrs',
            'wyyz', 'xz', 'xf', 'xxszd', 'szsf', 'dqmc', 'zdf1', 'skf1', 'zdf2', 'skf2', 'zdf3', 'skf3', 'zdf4', 'skf4', 'pjxc', 'pmfl', 'xccz', 'xnzypw',
            'zdf5', 'skf5',  'tjsx_name', 'zylqyz', 'yxgmsm', 'sylzy_name', 'bz', 'xzzy', 'jhcys', 'pmmc', 'zypm', 'ycfsbh', 'yczdf2',
            'yxlx', 'gkpm', 'xccz', 'zylb', 'xzzy_name', 'ylqpc3', 'ylqpc4', 'ylqpc5', 'zgbm', 'bxxz', 'zszcyq', 'zxkm',
            'mzyq', 'xbyq', 'gzdz', 'zyzdwc1', 'zyzdwc2', 'zyzdwc3', 'zyzdwc4', 'zyzdwc5', 'sxxz', 'snldzj', 'qnldzj' ,'yxpinyin', 'zypinyin'
        ]


class CollegeSerializer(ModelSerializer):

    class Meta:
        model = Yxzyxxb_lg
        fields = ['yxmc']


class MajorSerializer(ModelSerializer):

    class Meta:
        model = Yxzyxxb_lg
        fields = ['zymc']


class AreaSerializer(ModelSerializer):

    class Meta:
        model = Yxzyxxb_lg
        fields = ['dqmc']


class ProvinceSerializer(ModelSerializer):

    class Meta:
        model = Yxzyxxb_lg
        fields = ['szsf']


class CitySerializer(ModelSerializer):

    class Meta:
        model = Yxzyxxb_lg
        fields = ['xxszd']


class WsCollegeAdmissionSerializer(ModelSerializer):
    """
    院校文史专业信息表
    """
    eyy_name = serializers.CharField(source="get_eyy_display", read_only=True)
    jbw_name = serializers.CharField(source="get_jbw_display", read_only=True)
    zybs_name = serializers.CharField(source="get_zybs_display", read_only=True)
    qjjh_name = serializers.CharField(source="get_qjjh_display", read_only=True)
    sylzy_name = serializers.CharField(source="get_sylzy_display", read_only=True)
    xzzy_name = serializers.CharField(source="get_xzzy_display", read_only=True)
    tjsx_name = serializers.CharField(source="get_tjsx_display", read_only=True)
    gzdz = serializers.CharField(source="get_gzdz_display", read_only=True)

    class Meta:
        model = Yxzyxxb_ws
        fields = [
             'yxbsm', 'yxdm', 'yxmc', 'zybm', 'zymc', 'eyy_name', 'jbw_name', 'zybs_name', 'qjjh_name', 'syljs', 'lqpc', 'jhrs', 'qnjhrs',
            'wyyz', 'xz', 'xf', 'xxszd', 'szsf', 'dqmc', 'zdf1', 'skf1', 'zdf2', 'skf2', 'zdf3', 'skf3', 'zdf4', 'skf4', 'pjxc', 'pmfl', 'xccz', 'xnzypw',
            'zdf5', 'skf5',  'tjsx_name', 'zylqyz', 'yxgmsm', 'sylzy_name', 'bz', 'xzzy', 'jhcys', 'pmmc', 'zypm', 'ycfsbh', 'yczdf2',
            'yxlx', 'gkpm', 'xccz', 'zylb', 'xzzy_name', 'ylqpc3', 'ylqpc4', 'ylqpc5', 'zgbm', 'bxxz', 'zszcyq', 'zxkm',
            'mzyq', 'xbyq', 'gzdz', 'zyzdwc1', 'zyzdwc2', 'zyzdwc3', 'zyzdwc4', 'zyzdwc5', 'sxxz', 'snldzj', 'qnldzj'
        ]


class WsCollegeSerializer(ModelSerializer):

    class Meta:
        model = Yxzyxxb_ws
        fields = ['yxmc']


class WsMajorSerializer(ModelSerializer):

    class Meta:
        model = Yxzyxxb_ws
        fields = ['zymc']


class WsAreaSerializer(ModelSerializer):

    class Meta:
        model = Yxzyxxb_ws
        fields = ['dqmc']


class WsProvinceSerializer(ModelSerializer):

    class Meta:
        model = Yxzyxxb_ws
        fields = ['szsf']


class WsCitySerializer(ModelSerializer):

    class Meta:
        model = Yxzyxxb_ws
        fields = ['xxszd']
